package com.example.demo.Enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum UploadStrategyEnum {

    LOCAL_UPLOAD_STRATEGY("local", "localUploadStrategy"),
    OTHERS_UPLOAD_STRATEGY("others", "otherUploadStrategy");

    private final String strategyName;
    private final String strategyImpl;


    /**
     * Gets strategy.
     *
     * @param strategyName the strategy name
     * @return the strategy
     */
    public static String getStrategy(String strategyName) {
        for (UploadStrategyEnum value : values()) {
            if (value.strategyName.equals(strategyName)) {
                return value.strategyImpl;
            }
        }
        return null;
    }

}
